#include "weldinginitializationworker.h"
#include "weldingalgorithmmanager.h"

#include <Common/SysEnv.h>

namespace Alg {

WeldingInitializationWorker::WeldingInitializationWorker(QObject *parent)
    : QObject{parent}
{}

void WeldingInitializationWorker::doInitialize()
{
    // 配置参数

    std::vector<Params> params;
    Params param1;
    param1.weldingdetectorfile = "YOLO11S_F.onnx";
    param1.conf_thresh = 0.5;
    param1.nms_thresh = 0.3;

    Params param2;
    param2.weldingdetectorfile = "YOLO11S_Z.onnx";
    param2.conf_thresh = 0.5;
    param2.nms_thresh = 0.3;

    Params param3;
    param2.weldingdetectorfile = "yolov11_4.onnx";
    param2.conf_thresh = 0.5;
    param2.nms_thresh = 0.3;





    Params param4;
    param4.weldingdetectorfile = "YOLO11S_A.onnx";
    param4.conf_thresh = 0.5;
    param4.nms_thresh = 0.3;
    param4.Seg_weldingdetectorfile = "YOLOV11S-Seg.onnx";
    param4.Seg_conf_thresh = 0.5;
    param4.Seg_nms_thresh = 0.3;

    params.push_back(param1);
    params.push_back(param2);
    bool success = Obj<WeldingDetector>::GetInstance()->Initialize(param4);
    if (success)
        SysEnv::instance().setModuleOk(SysEnv::ALGO);
    else
        SysEnv::instance().setModuleBad(SysEnv::ALGO);
    emit initializationFinished(success);
}
}
